



#ifndef _PDF_COONS_PATCH_MESH_H_
#define _PDF_COONS_PATCH_MESH_H_

#include <wx/dynarray.h>

#include "wx/pdfdocdef.h"
#include "wx/pdfcolour.h"

/// Class representing a coons patch mesh.
class WXDLLIMPEXP_PDFDOC wxPdfCoonsPatchMesh
{
public:
  /// Constructor
  wxPdfCoonsPatchMesh();

  /// Destructor
  virtual ~wxPdfCoonsPatchMesh();

  /// Add patch to mesh
  
  bool AddPatch(int edgeFlag, wxPdfColour colours[], double x[], double y[]);

  /// Checks whether the coons patch mesh is valid
  
  bool Ok() const { return m_ok; }

  /// Get colour type of the coons patch mesh
  
  wxPdfColourType GetColourType() const { return m_colourType; }

  /// Get the number of patches
  
  size_t GetPatchCount() const { return m_patches.size(); }

  /// Get the array of patches
  
  const wxArrayPtrVoid* GetPatches() const { return &m_patches; }

private:
  bool            m_ok;         ///< flag whether the coons patch mesh is valid
  wxPdfColourType m_colourType; ///< colour type of the mesh
  wxArrayPtrVoid  m_patches;    ///< array of patches
};

#endif
